package com.atguigu.config;

import com.atguigu.bean.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * //@PropertySource加载配置文件后（加载到环境中，可用applicationContext.getEnvironment.getProperty取出）
 * 使用${}配置文件的值
 */
@Configuration

@PropertySource(value = {"classpath:/person.properties"})
public class MainConfig4 {

    @Bean
    public Person person() {
        return new Person();
    }

}
